#include "talkcode.h"
#include "ui_talkcode.h"
#include <iostream>




using namespace std;

TalkCode::TalkCode(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::TalkCode)
{
    ui->setupUi(this);
}

TalkCode::~TalkCode()
{
    delete ui;
}

void TalkCode::on_actionNew_triggered()
{
}

bool TalkCode::writeFile(const QString &fileName)
{
    QFile file(fileName);
    if (!file.open(QIODevice::WriteOnly)) {
        QMessageBox::warning(this, tr("Spreadsheet"),
                             tr("Cannot write file %1:\n%2.")
                             .arg(file.fileName())
                             .arg(file.errorString()));
        return false;
    }
    QDataStream out(&file);
    out.setVersion(QDataStream::Qt_4_1);
    //out << quint32(MagicNumber);
    QApplication::setOverrideCursor(Qt::WaitCursor);
    /*for (int row = 0; row < RowCount; ++row) {
        for (int column = 0; column < ColumnCount; ++column) {
            QString str = formula(row, column);
            if (!str.isEmpty())
                out << quint16(row) << quint16(column) << str;
        }
    }*/
    QApplication::restoreOverrideCursor();
    return true;
}


